/*! \file button.h	
	This is the header file for button.cpp
	
	This contains the Button class
*/

#ifndef BUTTON_H
#define BUTTON_H

#include "component.h"
#include "listener.h"
#include <string>

/**
	\class Button

	This is a text button
*/
using namespace std;

class Button : public Component, public Listener {
protected:
	int widthOfText;
	string label;
	bool depressed; // so sad
public:
	Button( Component* parent, string label = "" );

	virtual void draw();
	void update();
	void setDepressed( bool depressed = true ) { this->depressed = depressed; }
	bool isDepressed() { return depressed; }
	virtual void performAction(); // tell the listeners attached to this that this button was clicked
	virtual void keyDown( Event e );
	virtual void keyUp( Event e );
	virtual void mouseUp( Event e );
};



#endif
